<template>
  <div>
    <div class="pageTitleWhole">
      <a-breadcrumb>
        <a-breadcrumb-item>报表明细</a-breadcrumb-item>
      </a-breadcrumb>
    </div>
    <div class="pageContentWhole">
      <div style="overflow:hidden">
        <date-searcher @change="initDateSearch" style="float:left" />
        <div style="float:left">
          <a-button type="primary" @click="check" style="margin:0 20px 0 50px">查 询</a-button>
          <a-button type="primary" @click="excelExport">导出Excel</a-button>
        </div>
      </div>
      <a-card style="text-align:center; margin-top:24px;">
        <a-row :gutter="[16]" v-if="type !== 6">
          <a-col :span="3" class="assent">
            <div class="assent_mes">里程数（km）</div>
            <div class="assent_shu">{{statisticsObj.mileage || '--'}}</div>
          </a-col>
          <a-col :span="3" class="assent">
            <div class="assent_mes">耗油量（L）</div>
            <div class="assent_shu">{{statisticsObj.oilVolume || '--'}}</div>
          </a-col>
          <a-col :span="3" class="assent">
            <div class="assent_mes">箱量（个）</div>
            <div class="assent_shu">{{statisticsObj.containerNum || '--'}}</div>
          </a-col>
          <a-col :span="4" class="assent">
            <div class="assent_mes">总应收（元）</div>
            <div class="assent_shu">{{statisticsObj.receivableAmount || '--'}}</div>
          </a-col>
          <a-col :span="4" class="assent">
            <div class="assent_mes">总应付（元）</div>
            <div class="assent_shu">{{statisticsObj.payableAmount || '--'}}</div>
          </a-col>
          <a-col :span="4" class="assent">
            <div class="assent_mes">总毛利（元）</div>
            <div class="assent_shu">{{statisticsObj.profit || '--'}}</div>
          </a-col>
          <a-col :span="3">
            <div class="assent_mes">毛利率</div>
            <div
              class="assent_shu"
            >{{statisticsObj.profitRate || '--'}}{{statisticsObj.profitRate ? '%' : ''}}</div>
          </a-col>
        </a-row>
        <a-row :gutter="[16]" v-else>
          <a-col :span="4" class="assent">
            <div class="assent_mes">里程数（km）</div>
            <div class="assent_shu">{{statisticsObj.mileage || '--'}}</div>
          </a-col>
          <a-col :span="5" class="assent">
            <div class="assent_mes">耗油量（L）</div>
            <div class="assent_shu">{{statisticsObj.oilVolume || '--'}}</div>
          </a-col>
          <a-col :span="5" class="assent">
            <div class="assent_mes">总应收（元）</div>
            <div class="assent_shu">{{statisticsObj.receivableAmount || '--'}}</div>
          </a-col>
          <a-col :span="5" class="assent">
            <div class="assent_mes">总应付（元）</div>
            <div class="assent_shu">{{statisticsObj.payableAmount || '--'}}</div>
          </a-col>
          <a-col :span="5">
            <div class="assent_mes">总毛利（元）</div>
            <div class="assent_shu">{{statisticsObj.profit || '--'}}</div>
          </a-col>
        </a-row>
      </a-card>
      <a-tabs :tabBarGutter="16" @change="onChangetab" style="margin-top:30px" :animated="false">
        <a-tab-pane :key="1" tab="客户">
          <a-table
            :columns="columns1"
            :loading="loading"
            :data-source="list"
            :pagination="pagination"
            :row-key="(record,index) => index"
            @change="tableChange"
          ></a-table>
        </a-tab-pane>
        <a-tab-pane :key="2" tab="销售">
          <a-table
            :columns="columns2"
            :loading="loading"
            :data-source="list"
            :pagination="pagination"
            :row-key="(record,index) => index"
            @change="tableChange"
          ></a-table>
        </a-tab-pane>
        <a-tab-pane :key="5" tab="车辆">
          <a-table
            :columns="columns5"
            :loading="loading"
            :data-source="list"
            :pagination="pagination"
            :row-key="(record,index) => index"
            @change="tableChange"
          ></a-table>
        </a-tab-pane>
        <a-tab-pane :key="3" tab="司机">
          <a-table
            :columns="columns3"
            :loading="loading"
            :data-source="list"
            :pagination="pagination"
            :row-key="(record,index) => index"
            @change="tableChange"
          ></a-table>
        </a-tab-pane>
        <a-tab-pane :key="4" tab="订单类型">
          <a-table
            :columns="columns4"
            :loading="loading"
            :data-source="list"
            :pagination="pagination"
            :row-key="(record,index) => index"
            @change="tableChange"
          ></a-table>
        </a-tab-pane>
        <a-tab-pane :key="6" tab="其他油耗">
          <a-table
            :columns="columns6"
            :loading="loading"
            :data-source="list"
            :pagination="pagination"
            :row-key="(record,index) => index"
            :scroll="{x:1500}"
            @change="tableChange6"
          ></a-table>
        </a-tab-pane>
      </a-tabs>
    </div>
  </div>
</template>
<script>
import { commonExport } from '@/api/request'
import DateSearcher from '@/components/DateSearch'
import { queryJTReportInfo, queryJTReportSum } from '@/api/dataBI'
// 客户
const columns1 = [
  {
    title: '序号',
    width: 80,
    customRender: (text, record, index) => {
      return index + 1
    }
  },
  {
    title: '客户',
    dataIndex: 'custName'
  },
  {
    title: '箱量（个）',
    dataIndex: 'containerNum',
    sorter: (a, b) => a.containerNum - b.containerNum
  },
  {
    title: '里程数（km）',
    dataIndex: 'mileage',
    sorter: (a, b) => a.mileage - b.mileage
  },
  {
    title: '耗油量（L）',
    dataIndex: 'oilVolume',
    sorter: (a, b) => a.oilVolume - b.oilVolume
  },
  {
    title: '应收（元）',
    dataIndex: 'receivableAmount',
    sorter: (a, b) => a.receivableAmount - b.receivableAmount,
    customRender: (text, record, index) => {
      return record.receivableAmount.toFixed(2)
    }
  },
  {
    title: '应付（元）',
    dataIndex: 'payableAmount',
    sorter: (a, b) => a.payableAmount - b.payableAmount,
    customRender: (text, record, index) => {
      return record.payableAmount.toFixed(2)
    }
  },
  {
    title: '毛利（元）',
    dataIndex: 'profit',
    defaultSortOrder: 'descend',
    sorter: (a, b) => a.profit - b.profit,
    customRender: (text, record, index) => {
      return record.profit.toFixed(2)
    }
  },
  {
    title: '毛利率',
    dataIndex: 'profitRate',
    sorter: (a, b) => a.profitRate - b.profitRate,
    customRender: (text, record, index) => {
      return `${record.profitRate.toFixed(2)}%`
    }
  }
]
// 销售
const columns2 = [
  {
    title: '序号',
    width: 80,
    customRender: (text, record, index) => {
      return index + 1
    }
  },
  {
    title: '销售',
    dataIndex: 'sellerName'
  },
  {
    title: '箱量（个）',
    dataIndex: 'containerNum',
    defaultSortOrder: 'descend',
    sorter: (a, b) => a.containerNum - b.containerNum
  },
  {
    title: '里程数（km）',
    dataIndex: 'mileage',
    sorter: (a, b) => a.mileage - b.mileage
  },
  {
    title: '耗油量（L）',
    dataIndex: 'oilVolume',
    sorter: (a, b) => a.oilVolume - b.oilVolume
  },
  {
    title: '应收（元）',
    dataIndex: 'receivableAmount',
    sorter: (a, b) => a.receivableAmount - b.receivableAmount,
    customRender: (text, record, index) => {
      return record.receivableAmount.toFixed(2)
    }
  },
  {
    title: '应付（元）',
    dataIndex: 'payableAmount',
    sorter: (a, b) => a.payableAmount - b.payableAmount,
    customRender: (text, record, index) => {
      return record.payableAmount.toFixed(2)
    }
  },
  {
    title: '毛利（元）',
    dataIndex: 'profit',
    sorter: (a, b) => a.profit - b.profit,
    customRender: (text, record, index) => {
      return record.profit.toFixed(2)
    }
  },
  {
    title: '毛利率',
    dataIndex: 'profitRate',
    customRender: (text, record, index) => {
      return `${record.profitRate.toFixed(2)}%`
    },
    sorter: (a, b) => a.profitRate - b.profitRate
  }
]
// 司机
const columns3 = [
  {
    title: '序号',
    width: 80,
    customRender: (text, record, index) => {
      return index + 1
    }
  },
  {
    title: '司机',
    dataIndex: 'driverName'
  },
  {
    title: '箱量（个）',
    dataIndex: 'containerNum',
    defaultSortOrder: 'descend',
    sorter: (a, b) => a.containerNum - b.containerNum
  },
  {
    title: '里程数（km）',
    dataIndex: 'mileage',
    sorter: (a, b) => a.mileage - b.mileage
  },
  {
    title: '耗油量（L）',
    dataIndex: 'oilVolume',
    sorter: (a, b) => a.oilVolume - b.oilVolume
  },
  {
    title: '应收（元）',
    dataIndex: 'receivableAmount',
    sorter: (a, b) => a.receivableAmount - b.receivableAmount,
    customRender: (text, record, index) => {
      return record.receivableAmount.toFixed(2)
    }
  },
  {
    title: '应付（元）',
    dataIndex: 'payableAmount',
    sorter: (a, b) => a.payableAmount - b.payableAmount,
    customRender: (text, record, index) => {
      return record.payableAmount.toFixed(2)
    }
  },
  {
    title: '毛利（元）',
    dataIndex: 'profit',
    sorter: (a, b) => a.profit - b.profit,
    customRender: (text, record, index) => {
      return record.profit.toFixed(2)
    }
  },
  {
    title: '毛利率',
    dataIndex: 'profitRate',
    customRender: (text, record, index) => {
      return `${record.profitRate.toFixed(2)}%`
    },
    sorter: (a, b) => a.profitRate - b.profitRate
  }
]
// 订单类型
const columns4 = [
  {
    title: '序号',
    width: 80,
    customRender: (text, record, index) => {
      return index + 1
    }
  },
  {
    title: '订单类型',
    dataIndex: 'orderType'
  },
  {
    title: '箱量（个）',
    dataIndex: 'containerNum',
    defaultSortOrder: 'descend',
    sorter: (a, b) => a.containerNum - b.containerNum
  },
  {
    title: '里程数（km）',
    dataIndex: 'mileage',
    sorter: (a, b) => a.mileage - b.mileage
  },
  {
    title: '耗油量（L）',
    dataIndex: 'oilVolume',
    sorter: (a, b) => a.oilVolume - b.oilVolume
  },
  {
    title: '应收（元）',
    dataIndex: 'receivableAmount',
    sorter: (a, b) => a.receivableAmount - b.receivableAmount,
    customRender: (text, record, index) => {
      return record.receivableAmount.toFixed(2)
    }
  },
  {
    title: '应付（元）',
    dataIndex: 'payableAmount',
    sorter: (a, b) => a.payableAmount - b.payableAmount,
    customRender: (text, record, index) => {
      return record.payableAmount.toFixed(2)
    }
  },
  {
    title: '毛利（元）',
    dataIndex: 'profit',
    sorter: (a, b) => a.profit - b.profit,
    customRender: (text, record, index) => {
      return record.profit.toFixed(2)
    }
  },
  {
    title: '毛利率',
    dataIndex: 'profitRate',
    customRender: (text, record, index) => {
      return `${record.profitRate.toFixed(2)}%`
    },
    sorter: (a, b) => a.profitRate - b.profitRate
  }
]
// 车辆
const columns5 = [
  {
    title: '序号',
    width: 80,
    customRender: (text, record, index) => {
      return index + 1
    }
  },
  {
    title: '车辆',
    dataIndex: 'truckNumber',
    customRender: (text, record, index) => {
      return record.truckNumber || '--'
    }
  },
  {
    title: '箱量（个）',
    dataIndex: 'containerNum',
    defaultSortOrder: 'descend',
    sorter: (a, b) => a.containerNum - b.containerNum
  },
  {
    title: '里程数（km）',
    dataIndex: 'mileage',
    sorter: (a, b) => a.mileage - b.mileage
  },
  {
    title: '耗油量（L）',
    dataIndex: 'oilVolume',
    sorter: (a, b) => a.oilVolume - b.oilVolume
  },
  {
    title: '应收（元）',
    dataIndex: 'receivableAmount',
    sorter: (a, b) => a.receivableAmount - b.receivableAmount,
    customRender: (text, record, index) => {
      return record.receivableAmount.toFixed(2)
    }
  },
  {
    title: '应付（元）',
    dataIndex: 'payableAmount',
    sorter: (a, b) => a.payableAmount - b.payableAmount,
    customRender: (text, record, index) => {
      return record.payableAmount.toFixed(2)
    }
  },
  {
    title: '毛利（元）',
    dataIndex: 'profit',
    sorter: (a, b) => a.profit - b.profit,
    customRender: (text, record, index) => {
      return record.profit.toFixed(2)
    }
  },
  {
    title: '毛利率',
    dataIndex: 'profitRate',
    customRender: (text, record, index) => {
      return `${record.profitRate.toFixed(2)}%`
    },
    sorter: (a, b) => a.profitRate - b.profitRate
  }
]
// 其他油耗
const columns6 = [
  {
    title: '序号',
    width: 80,
    customRender: (text, record, index) => {
      return index + 1
    }
  },
  {
    title: '业务类型',
    dataIndex: 'businessType',
    customRender: (text, record, index) => {
      return record.businessType || '--'
    }
  },
  {
    title: '牵引车',
    dataIndex: 'tractor',
    customRender: (text, record, index) => {
      return record.tractor || '--'
    }
  },
  {
    title: '挂车',
    dataIndex: 'trailer',
    customRender: (text, record, index) => {
      return record.trailer || '--'
    }
  },
  {
    title: '司机',
    dataIndex: 'driverName',
    customRender: (text, record, index) => {
      return record.driverName || '--'
    }
  },
  {
    title: '里程数（km）',
    dataIndex: 'mileage',
    sorter: (a, b) => a.mileage - b.mileage
  },
  {
    title: '耗油量（L）',
    dataIndex: 'oilVolume',
    sorter: (a, b) => a.oilVolume - b.oilVolume
  },
  {
    title: '应收（元）',
    dataIndex: 'receivableAmount',
    sorter: (a, b) => a.receivableAmount - b.receivableAmount,
    customRender: (text, record, index) => {
      return record.receivableAmount.toFixed(2)
    }
  },
  {
    title: '应付（元）',
    dataIndex: 'payableAmount',
    sorter: (a, b) => a.payableAmount - b.payableAmount,
    customRender: (text, record, index) => {
      return record.payableAmount.toFixed(2)
    }
  },
  {
    title: '毛利（元）',
    dataIndex: 'profit',
    sorter: (a, b) => a.profit - b.profit,
    customRender: (text, record, index) => {
      return record.profit.toFixed(2)
    }
  },
  {
    title: '日期',
    dataIndex: 'createTime',
    defaultSortOrder: 'descend',
    customRender: (text, record, index) => {
      return record.createTime || '--'
    }
  }
]
export default {
  components: {
    [DateSearcher.name]: DateSearcher
  },
  data () {
    return {
      pageNum: 1,
      pageSize: 10,
      type: 1, // 类型；1客户、2销售、3司机、4订单类型、5车辆、6其他油耗
      statisticsObj: {},
      startDate: '',
      endDate: '',
      loading: true,
      columns1,
      columns2,
      columns3,
      columns4,
      columns5,
      columns6,
      list: [],
      pagination: {},
      sortField: ''
    }
  },
  methods: {
    tableChange (pagination, filters, sorter) {
      let columnKey = sorter.columnKey
      let sorterOrder = sorter.order
      if (columnKey === 'containerNum') {
        if (sorterOrder) {
          this.sortField = columnKey + ' ' + (sorterOrder === 'ascend' ? 'asc' : 'desc')
          this.submit()
        } else {
          this.sortField = ''
          this.submit2()
        }
      } else if (columnKey === 'mileage') {
        if (sorterOrder) {
          this.sortField = columnKey + ' ' + (sorterOrder === 'ascend' ? 'asc' : 'desc')
          this.submit()
        } else {
          this.sortField = ''
          this.submit2()
        }
      } else if (columnKey === 'oilVolume') {
        if (sorterOrder) {
          this.sortField = columnKey + ' ' + (sorterOrder === 'ascend' ? 'asc' : 'desc')
          this.submit()
        } else {
          this.sortField = ''
          this.submit2()
        }
      } else if (columnKey === 'receivableAmount') {
        if (sorterOrder) {
          this.sortField = columnKey + ' ' + (sorterOrder === 'ascend' ? 'asc' : 'desc')
          this.submit()
        } else {
          this.sortField = ''
          this.submit2()
        }
      } else if (columnKey === 'payableAmount') {
        if (sorterOrder) {
          this.sortField = columnKey + ' ' + (sorterOrder === 'ascend' ? 'asc' : 'desc')
          this.submit()
        } else {
          this.sortField = ''
          this.submit2()
        }
      } else if (columnKey === 'profit') {
        if (sorterOrder) {
          this.sortField = columnKey + ' ' + (sorterOrder === 'ascend' ? 'asc' : 'desc')
          this.submit()
        } else {
          this.sortField = ''
          this.submit2()
        }
      } else if (columnKey === 'profitRate') {
        if (sorterOrder) {
          this.sortField = columnKey + ' ' + (sorterOrder === 'ascend' ? 'asc' : 'desc')
          this.submit()
        } else {
          this.sortField = ''
          this.submit2()
        }
      }
    },
    tableChange6 (pagination, filters, sorter) {
      let columnKey = sorter.columnKey
      let sorterOrder = sorter.order
      // console.log(columnKey)
      // console.log(sorterOrder)
      if (columnKey === 'mileage') {
        if (sorterOrder) {
          this.sortField = columnKey + ' ' + (sorterOrder === 'ascend' ? 'asc' : 'desc')
          this.submit()
        } else {
          this.sortField = ''
          this.submit2()
        }
      } else if (columnKey === 'oilVolume') {
        if (sorterOrder) {
          this.sortField = columnKey + ' ' + (sorterOrder === 'ascend' ? 'asc' : 'desc')
          this.submit()
        } else {
          this.sortField = ''
          this.submit2()
        }
      } else if (columnKey === 'receivableAmount') {
        if (sorterOrder) {
          this.sortField = columnKey + ' ' + (sorterOrder === 'ascend' ? 'asc' : 'desc')
          this.submit()
        } else {
          this.sortField = ''
          this.submit2()
        }
      } else if (columnKey === 'payableAmount') {
        if (sorterOrder) {
          this.sortField = columnKey + ' ' + (sorterOrder === 'ascend' ? 'asc' : 'desc')
          this.submit()
        } else {
          this.sortField = ''
          this.submit2()
        }
      } else if (columnKey === 'profit') {
        if (sorterOrder) {
          this.sortField = columnKey + ' ' + (sorterOrder === 'ascend' ? 'asc' : 'desc')
          this.submit()
        } else {
          this.sortField = ''
          this.submit2()
        }
      } else if (columnKey === 'profitRate') {
        if (sorterOrder) {
          this.sortField = columnKey + ' ' + (sorterOrder === 'ascend' ? 'asc' : 'desc')
          this.submit()
        } else {
          this.sortField = ''
          this.submit2()
        }
      }
    },
    reportInfoRequest (e) {
      this.loading = true
      queryJTReportInfo(e)
        .then(res => {
          // // console.log(res.data)
          this.list = res.data.list
          let currentPage = this.pageNum
          this.pagination = {
            current: currentPage,
            pageSize: res.data.pageSize,
            total: res.data.total,
            showQuickJumper: false,
            showSizeChanger: true,
            showTotal: total =>
              `共${total}条记录 第${currentPage}/${res.data.pages}页`,
            onChange: pageNum => {
              this.pageNum = pageNum
              let paramData = {
                pageSize: this.pageSize,
                pageNum: this.pageNum,
                startQueryDate: this.startDate,
                endQueryDate: this.endDate,
                type: this.type
              }
              this.reportInfoRequest(paramData)
            },
            onShowSizeChange: (current, size) => {
              this.pageNum = current
              this.pageSize = size
              let paramData = {
                pageSize: this.pageSize,
                pageNum: this.pageNum,
                startQueryDate: this.startDate,
                endQueryDate: this.endDate,
                type: this.type
              }
              this.reportInfoRequest(paramData)
            }
          }
          setTimeout(() => {
            this.loading = false
          }, 500)
        })
        .catch(rs => {})
    },
    reportSumRequest (e) {
      this.loading = true
      queryJTReportSum(e)
        .then(res => {
          // // console.log(res.data)
          let resData = res.data
          if (resData.receivableAmount) {
            resData.receivableAmount = resData.receivableAmount.toFixed(2)
          }
          if (resData.payableAmount) {
            resData.payableAmount = resData.payableAmount.toFixed(2)
          }
          if (resData.profit) {
            resData.profit = resData.profit.toFixed(2)
          }
          if (resData.profitRate) {
            resData.profitRate = resData.profitRate.toFixed(2)
          }
          this.statisticsObj = resData
          this.loading = false
        })
        .catch(rs => {})
    },
    initDateSearch (type, dateStr) {
      // 获得搜索日期, dateStr: [startDateStr, endDateStr]
      // console.log(dateStr)
      this.startDate = dateStr[0]
      this.endDate = dateStr[1]
      if (this.type === 1) {
        this.sortField = 'profit desc'
      } else if (this.type === 2) {
        this.sortField = 'containerNum desc'
      } else if (this.type === 3) {
        this.sortField = 'containerNum desc'
      } else if (this.type === 4) {
        this.sortField = 'containerNum desc'
      } else if (this.type === 5) {
        this.sortField = 'containerNum desc'
      } else if (this.type === 6) {
        this.sortField = 'createTime desc'
      }
      this.reportInfoRequest({
        startQueryDate: dateStr[0],
        endQueryDate: dateStr[1],
        type: this.type,
        pageNum: this.pageNum,
        pageSize: this.pageSize,
        sortField: this.sortField
      })
      this.reportSumRequest({
        type: this.type,
        startQueryDate: dateStr[0],
        endQueryDate: dateStr[1]
      })
    },
    onChangetab (key) {
      // // console.log(key)
      this.pageNum = 1
      this.pageSize = 10
      this.type = key
      if (this.type === 1) {
        this.sortField = 'profit desc'
      } else if (this.type === 2) {
        this.sortField = 'containerNum desc'
      } else if (this.type === 3) {
        this.sortField = 'containerNum desc'
      } else if (this.type === 4) {
        this.sortField = 'containerNum desc'
      } else if (this.type === 5) {
        this.sortField = 'containerNum desc'
      } else if (this.type === 6) {
        this.sortField = 'createTime desc'
      }
      this.reportInfoRequest({
        startQueryDate: this.startDate,
        endQueryDate: this.endDate,
        type: this.type,
        pageNum: this.pageNum,
        pageSize: this.pageSize,
        sortField: this.sortField
      })
      this.reportSumRequest({
        type: this.type,
        startQueryDate: this.startDate,
        endQueryDate: this.endDate
      })
    },
    check () {
      this.reportInfoRequest({
        startQueryDate: this.startDate,
        endQueryDate: this.endDate,
        type: this.type,
        pageNum: this.pageNum,
        pageSize: this.pageSize,
        sortField: this.sortField
      })
      this.reportSumRequest({
        startQueryDate: this.startDate,
        endQueryDate: this.endDate
      })
    },
    submit2 () {
      this.reportInfoRequest({
        startQueryDate: this.startDate,
        endQueryDate: this.endDate,
        type: this.type,
        pageNum: this.pageNum,
        pageSize: this.pageSize,
        sortField: this.sortField
      })
    },
    submit () {
      this.loading = true
      queryJTReportInfo({
        startQueryDate: this.startDate,
        endQueryDate: this.endDate,
        type: this.type,
        pageNum: this.pageNum,
        pageSize: this.pageSize,
        sortField: this.sortField
      })
        .then(res => {
          // // console.log(res.data)
          this.list = res.data.list
          let currentPage = this.pageNum
          this.pagination = {
            current: currentPage,
            pageSize: res.data.pageSize,
            total: res.data.total,
            showQuickJumper: false,
            showSizeChanger: true,
            showTotal: total =>
              `共${total}条记录 第${currentPage}/${res.data.pages}页`,
            onChange: pageNum => {
              this.pageNum = pageNum
              // let paramData = {
              //   pageSize: this.pageSize,
              //   pageNum: this.pageNum,
              //   startQueryDate: this.startDate,
              //   endQueryDate: this.endDate,
              //   type: this.type
              // }
              // this.reportInfoRequest(paramData)
            },
            onShowSizeChange: (current, size) => {
              this.pageNum = current
              this.pageSize = size
              // let paramData = {
              //   pageSize: this.pageSize,
              //   pageNum: this.pageNum,
              //   startQueryDate: this.startDate,
              //   endQueryDate: this.endDate,
              //   type: this.type
              // }
              // this.reportInfoRequest(paramData)
            }
          }
          setTimeout(() => {
            this.loading = false
          }, 500)
        })
        .catch(rs => {})
    },
    excelExport () {
      let columns
      if (this.type === 1) {
        columns = this.columns1
      } else if (this.type === 2) {
        columns = this.columns2
      } else if (this.type === 3) {
        columns = this.columns3
      } else if (this.type === 4) {
        columns = this.columns4
      } else if (this.type === 5) {
        columns = this.columns5
      } else if (this.type === 6) {
        columns = this.columns6
      }
      commonExport('/truckReport/exportJTReportInfo', {
        startQueryDate: this.startDate,
        endQueryDate: this.endDate,
        type: this.type,
        pageNum: this.pageNum,
        pageSize: this.pageSize,
        columns: columns
      })
    }
  },
  mounted () {}
}
</script>
